import cv2
syn_img = cv2.imread(r'd:/yehaibo_Blood.jpg')

# 小于220，赋值为255，其他值为0
_, syn_binary_inv = cv2.threshold(syn_img, 220, 255, cv2.THRESH_BINARY_INV)

# 大于220，赋值为255，其他值为0
_, syn_binary = cv2.threshold(syn_img, 230, 255, cv2.THRESH_BINARY)

cv2.imwrite('yehaiboxx.jpg',syn_binary)